package cc.zy.base.businesses.utils;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.context.ServletContextAware;

import javax.servlet.ServletContext;

@Component
@Slf4j
public class CatchMapUtil implements ServletContextAware {
    @Override
    public void setServletContext(ServletContext servletContext) {
        String contextPath = servletContext.getContextPath();

        if ("".equals(contextPath) || "/".equals(contextPath)){
            log.debug("路径错误");
        }else {
            throw new RuntimeException("此次路径为：" + contextPath);
        }
    }
}
